﻿using System.Data.Entity;
using Warranty.Configuration;
using Warranty.Data.DBConfig;
using Warranty.DBConfig;
using Warranty.Model.Model;

namespace Warranty.Data
{

    public class WarrantyEntities : DbContext
    {
        public WarrantyEntities() : base(SystemConfiguration.ConnectionString) { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //basic
            modelBuilder.Configurations.Add(new OrderShipHistConfiguration());
            modelBuilder.Configurations.Add(new DealerConfiguration());
            modelBuilder.Configurations.Add(new WarrantyMasterConfiguration());
            modelBuilder.Configurations.Add(new WarrantyMessageConfiguration());
            modelBuilder.Configurations.Add(new WarrantyHistoryConfiguration());
            modelBuilder.Configurations.Add(new MessageHistoryConfiguration());
            modelBuilder.Configurations.Add(new MessageSendConfiguration());
            //DBLink mapping
            modelBuilder.Configurations.Add(new SerialNoPrintedConfiguration());
            modelBuilder.Configurations.Add(new AddWMSinpLogConfiguration());
            modelBuilder.Configurations.Add(new WorkOrderConfiguration());
            modelBuilder.Configurations.Add(new SerialNumberPndHistConfiguration());
            modelBuilder.Configurations.Add(new ResponseSMSConfiguration());
        }


        //basic
        public DbSet<OrderShipHist> OrderShipHistories { get; set; }
        public DbSet<Dealer> Dealers { get; set; }
        public DbSet<WarrantyMaster> WarrantyMessages { get; set; }
        public DbSet<WarrantyMessage> WarrantyMessages0 { get; set; }
        public DbSet<WarrantyHistory> WarrantyHistory { get; set; }
        public DbSet<MessageHistory> MessageHistory { get; set; }
        public DbSet<MessageSend> MessageSend { get; set; }
        public DbSet<ResponseSMS> ResponseSMS { get; set; }
        //DBLink mapping
        public DbSet<SerialNoPrinted> SerialNoPrinted { get; set; }
        public DbSet<AddWMSinpLog> AddWMSinpLog { get; set; }
        public DbSet<WorkOrder> WorkOrders { get; set; }
        public DbSet<SerialNumberPndHist> SerialNumberPndHist { get; set; }
    }
}
